package com.csc775.gui;

import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.Socket;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.csc775.networking.Client;
import com.example.R;


public class LoginActivity extends Activity {
    
    private EditText text;
    EditText username;
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.registration);
     //   username = (EditText)findViewById(R.id.regNewUser);
        Button register = (Button) findViewById(R.id.RegisterPageButton);
        register.setOnClickListener(new View.OnClickListener() {
            @Override
			public void onClick(View view) {
            	
                Intent intent = new Intent();
                setResult(RESULT_OK, intent);
                  
                             finish();
                             Client c = new Client();
                         	  c.run();
               
            }

        });
        Button cancel = (Button) findViewById(R.id.cancelButton);
        cancel.setOnClickListener(new View.OnClickListener() {
            @Override
			public void onClick(View view) {
                Intent intent = new Intent();
                setResult(RESULT_OK, intent);
                finish();
               System.exit(1);
            }

        });
    }
}